<h2>Votre visite salle par salle</h2>
<?php 
	if ($query_rooms->num_rows() > 0){
		
		$row = $query_rooms->first_row();
		$row_id = $row->id;
		?><table><?php
		
		for($y = 1; $y< 5;$y++){
		
			?><tr><?php for($x = 1; $x < 7; $x++){
							if (($row->position_x == $x) and ($row->position_y == $y) and ($row->is_private == 'false')){
							// if the room exists in database and is not private, we show it on the grid 
							?><td><a href="javascript:void(null)" onclick="showRoom(<?= $row->id; ?>);"><span><?=$row->name?></span></a></td>
							<?php // get the next row
							 $row = $query_rooms->next_row();
							}
							
							else {
								if($row->is_private == 'true'){							 
									$row = $query_rooms->next_row();
								}
							// else we offer to add a room to the expo in this place
					?><td></td>
					<?php 
				}
		}?>
		</tr><?php
	}?>
</table><?php
	}
	
	?>
	
	<script type="text/javascript">

$(document).ready(function() {
	showRoom(<?php echo $row_id;?>);
	});
	</script>